package org.lrq.voidwalker.capricornus.crawler.qqTech;

import com.geccocrawler.gecco.annotation.PipelineName;
import com.geccocrawler.gecco.pipeline.Pipeline;
import java.net.UnknownHostException;
import java.util.Map;
import org.lrq.voidwalker.capricornus.client.ESClient;

/**
 * Created by macbook on 6/10/17.
 */
@PipelineName("QQTechArticlePipeLine")
public class QQTechArticlePipeLine implements Pipeline<QQTechArticle> {

    public void process(QQTechArticle qqTechArticle) {
        Map<String,Object> map = qqTechArticle.getMapBean();
      try {
        ESClient.getInstance().saveArticle(map, "QQTech",map.get("articleId").toString());
      } catch (UnknownHostException e) {
        e.printStackTrace();
      }
    }
}
